Repository navigation
fix(bgp): pick the right .so files for the AAR - #520
Merged
Merged
Conversation
Embed the app module's own libs and the libs of embedded libraries in both useStrippedSoFiles modes, and leave out libs that only come from Maven dependencies. Restore dynamicLibs, follow the app module's ABIs, and write the left-out libs to build/reports/brownfield/<variant>/skipped-so.txt.
KisaneNeko
marked this pull request as draft
November 5, 2026 13:43
KisaneNeko
marked this pull request as ready for review
November 5, 2026 14:01
andrei-zgirvaci
approved these changes
Nov 6, 2026
andrei-zgirvaci
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! This fixes our blocker. Thank you!
hurali97
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The plugin picked the wrong
.sofiles for the AAR, and the host app failed in both modes:useStrippedSoFiles = false, the AAR had nolibappmodules.soorlibreact_codegen_*.so, so the host crashed at runtime. It also embeddedlibc++_shared.so,libreactnative.soand other React Native libs, so the host build failed on duplicates.useStrippedSoFiles = true, it embedded the.sofiles of every Maven dependency. The host gets those from the POM as well, so its build failed with2 files found with path 'lib/<abi>/<name>.so'whenever the two versions differ.Both are regressions from v1, which always embedded the app module's libs and, in stripped mode, only the libs the embedded libraries ship:
useStrippedSoFilesis on, so unstripped builds lost them..sothat isn't ignored" and removeddynamicLibs, which led to the duplicates.Change
JNILibsProcessor.kt: both modes now use one rule. The AAR gets the app module's own libs plus the libs of embedded libraries, minus the ignore list. Libs that only come from Maven dependencies stay out, because the host resolves them through the POM. The flag now only picks the stripped or unstripped source.abiFilterssetup can't produce an ABI folder withoutlibappmodules.so.reactBrownfield.dynamicLibsis back, for a.sothe host can't get any other way (built or shipped by the app module, or a local file dependency).<module>/build/reports/brownfield/<variant>/skipped-so.txt. The build prints a one-line summary.dynamicLibsentries that match nothing or that an ignore entry drops.Verified on
mainand on this branch with ExpoApp57 and RNApp, consumed by AndroidApp:mainfails in both modes (the duplicate error was reproduced with a differentanimated-gifversion in the host)..soset as onmain.Before merging
A brownfield app with more native modules than our demo apps should build against a snapshot of this branch, and its
skipped-so.txtshould list only libs from Maven dependencies the host declares. A lib missing there would crash at runtime, and the demo apps can't show that.